package outman.weibo.ui;

import outman.weibo.AccountInfo;
import outman.weibo.R;
import outman.weibo.WeiboClient;
import android.app.TabActivity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TabHost;

public class MainTabsActivity extends TabActivity {

    private static final String TAG = "MainTabsActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	setContentView(R.layout.main_tabs);

	TabHost tabHost = getTabHost();

	// homeActivity的分页
	Intent homeIntent = new Intent(this, HomeActivity.class);
	TabHost.TabSpec homeSpec = tabHost.newTabSpec("");
	homeSpec.setIndicator("");
	homeSpec.setContent(homeIntent);
	tabHost.addTab(homeSpec);

	RadioGroup radioGroup = (RadioGroup) findViewById(R.id.maintabs_radio_group);
	RadioButton homeRadioButton = (RadioButton) findViewById(R.id.maintabs_radio_home);

	// homeActivity作为默认显示页
	homeRadioButton.setChecked(true);

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {

	MenuInflater inflater = getMenuInflater();
	inflater.inflate(R.menu.maintabs_menu, menu);

	return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onMenuItemSelected(int featureId, MenuItem item) {

	switch (item.getItemId()) {

	case R.id.test1:

	    // get the public time line

	    break;
	case R.id.test2:

	    break;
	case R.id.test3:

	    break;
	default:
	    break;
	}

	return super.onMenuItemSelected(featureId, item);
    }
}
